home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / M2Crypto / ASN1.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-13  |  4KB  |  115 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. import BIO
  5. import m2
  6. MBSTRING_FLAG = 4096
  7. MBSTRING_ASC = MBSTRING_FLAG | 1
  8. MBSTRING_BMP = MBSTRING_FLAG | 2
  9.  
  10. class ASN1_Integer:
  11.     m2_asn1_integer_free = m2.asn1_integer_free
  12.     
  13.     def __init__(self, asn1int, _pyfree = 0):
  14.         self.asn1int = asn1int
  15.         self._pyfree = _pyfree
  16.  
  17.     
  18.     def __cmp__(self, other):
  19.         return m2.asn1_integer_cmp(self.asn1int, other.asn1int)
  20.  
  21.     
  22.     def __del__(self):
  23.         if self._pyfree:
  24.             self.m2_asn1_integer_free(self.asn1int)
  25.         
  26.  
  27.  
  28.  
  29. class ASN1_String:
  30.     m2_asn1_string_free = m2.asn1_string_free
  31.     
  32.     def __init__(self, asn1str, _pyfree = 0):
  33.         self.asn1str = asn1str
  34.         self._pyfree = _pyfree
  35.  
  36.     
  37.     def __str__(self):
  38.         buf = BIO.MemoryBuffer()
  39.         m2.asn1_string_print(buf.bio_ptr(), self.asn1str)
  40.         return buf.read_all()
  41.  
  42.     
  43.     def __del__(self):
  44.         if getattr(self, '_pyfree', 0):
  45.             self.m2_asn1_string_free(self.asn1str)
  46.         
  47.  
  48.     
  49.     def _ptr(self):
  50.         return self.asn1str
  51.  
  52.     
  53.     def as_text(self, flags = 0):
  54.         buf = BIO.MemoryBuffer()
  55.         m2.asn1_string_print_ex(buf.bio_ptr(), self.asn1str, flags)
  56.         return buf.read_all()
  57.  
  58.  
  59.  
  60. class ASN1_Object:
  61.     m2_asn1_object_free = m2.asn1_object_free
  62.     
  63.     def __init__(self, asn1obj, _pyfree = 0):
  64.         self.asn1obj = asn1obj
  65.         self._pyfree = _pyfree
  66.  
  67.     
  68.     def __del__(self):
  69.         if self._pyfree:
  70.             self.m2_asn1_object_free(self.asn1obj)
  71.         
  72.  
  73.     
  74.     def _ptr(self):
  75.         return self.asn1obj
  76.  
  77.  
  78.  
  79. class ASN1_UTCTIME:
  80.     m2_asn1_utctime_free = m2.asn1_utctime_free
  81.     
  82.     def __init__(self, asn1_utctime = None, _pyfree = 0):
  83.         if asn1_utctime is not None:
  84.             self.asn1_utctime = asn1_utctime
  85.             self._pyfree = _pyfree
  86.         else:
  87.             self.asn1_utctime = m2.asn1_utctime_new()
  88.             self._pyfree = 1
  89.  
  90.     
  91.     def __del__(self):
  92.         if getattr(self, '_pyfree', 0):
  93.             self.m2_asn1_utctime_free(self.asn1_utctime)
  94.         
  95.  
  96.     
  97.     def __str__(self):
  98.         buf = BIO.MemoryBuffer()
  99.         m2.asn1_utctime_print(buf.bio_ptr(), self.asn1_utctime)
  100.         return buf.read_all()
  101.  
  102.     
  103.     def _ptr(self):
  104.         return self.asn1_utctime
  105.  
  106.     
  107.     def set_string(self, string):
  108.         return m2.asn1_utctime_set_string(self.asn1_utctime, string)
  109.  
  110.     
  111.     def set_time(self, time):
  112.         return m2.asn1_utctime_set(self.asn1_utctime, time)
  113.  
  114.  
  115.